package cn.crawler.app.crown.commons.websocket.main.monitor;

import cn.crawler.app.crown.commons.websocket.main.base.NettyCache;
import io.netty.channel.ChannelHandlerContext;
import org.nutz.ioc.loader.annotation.IocBean;

/**
 * 默认拦截器
 *
 * @author 22099
 */
@IocBean
@NettyMonitor(order = 0)
public class DefaultNettyMonitor extends BaseNettyMonitor {
    @Override
    public void added(ChannelHandlerContext ctx) {
        NettyCache.init(ctx.channel());
    }

    @Override
    public void removed(ChannelHandlerContext ctx) {
        NettyCache.destroy(ctx.channel());
    }
}
